﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectSunny.Admin.Controls
{
    public partial class ListContact : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //Them du lieu vao cat 1

                rpt_contact.DataSource = DAL.DCollector.DBCollector.Instance.StoredSelectTable("tbl_Contact");

                rpt_contact.DataBind();
                //hdhfhsdhsdh
            }
        }

        protected void rpt_contact_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "delete")
            {
                string id = (e.CommandArgument.ToString());

                DAL.DCollector.DBCollector.Instance.CallSQL1Param( "delete from tbl_Contact where Contact_ID=" + id, false);

                rpt_contact.DataSource = DAL.DCollector.DBCollector.Instance.StoredSelectTable("tbl_Contact", " * ", "selectbycolumns");

                rpt_contact.DataBind();
            }
        }
    }
}